module.exports = function(e) {
	// 公用模块用法请参考 https://uniapp.dcloud.io/uniCloud/cf-common
	return e
}
const {
	mainSpaceId
} = require('config-space')
const service_name = "catering_alipay"


/**支付宝请求公共接口
 * @param {string} appId 商家本地平台唯一标识
 * @param {string} url 支付宝请求地址
 * @param {Object} biz_content 请求参数 没有值时建议传值 NULL
 * @param {Object} params 公共请求参数请求参数
 */
async function alipayRequestCommon(appId, url, biz_content, params) {
	let callFunctionResult = await uniCloud.init({
		provider: 'tencent',
		spaceId: mainSpaceId
	}).callFunction({
		name: service_name,
		data: {
			path: '/alipaySdkUtills/alipayRequestCommon',
			data: {
				appId: appId,
				url: url,
				biz_content: biz_content,
				params: params
			}
		}
	})
	let result = callFunctionResult.result
	return result
}

module.exports = {
	alipayRequestCommon
}
